import axios from "~/axios"
import { queryParams } from "~/composables/util"

// 获取商品列表接口
export function getAgentList(page, query = {}) {
    let r = queryParams(query)
    return axios.get(`/admin/agent/${page}${r}`)
}

// 获取代理商订单列表接口
export function getAgentOrderList(page, query = {}) {
    let r = queryParams(query)
    return axios.get(`/admin/user_bill/${page}${r}`)
}

// 获取代理商统计信息
export function getAgentStatistics() {
    return axios.get('/admin/agent/statistics')
}

// 获取代理商配置信息
export function getConfig(){
    return axios.get(`/admin/distribution_setting/get`)
}

// 设置代理商配置信息
export function setConfig(data) {
    return axios.post(`/admin/distribution_setting/set`, data)
}